A Read-Only Memory (ROM) is often used to store programs for computers, especially in microcomputer systems. The ROM is particularly useful since the programs are retained during power outages and may not be overwritten by programming errors. However, when one or more programs require change or updating, the conventional approach is to provide and then install a complete new ROM. The expense of such a change may be large, especially in a distributed processing system which incorporates remotely located computers, so errors generally have been corrected only when economically feasible or when they become deleterious to system operation. The present invention obviates these changes if the microcomputer system is configured with Random-Access Memory (RAM) and each ROM based program includes a test to determine if any ROM program is to be replaced by a RAM program. The following background discussion describes the standard subroutine or function linkages exploited by the present invention to effect such a test.
In certain high-level languages exemplified, for instance, by FORTRAN or C, the sequence of operations on a call to a subroutine or function from a calling routine is an essential part of the particular language. This is required since other processes, such as the loader or assembler associated with the system implementing the language, must interface with the language and its calling sequence. For example, because of this well-defined sequence of operations, a called subroutine need not be compiled at the same time as the calling routine. When the compiler processes a subroutine, one of its operations involves the allocation of storage for local variables. Typically each of these variables is stored in a memory area designated as a stack space or simply, stack, so space may be allocated by adjusting the stack pointer. Moreover, the contents of the stack upon entry to a subroutine are saved so that the stack may be restored to its original state upon exiting the called routine.
These programming properties, in combination with systems employing RAM, may be utilized to change or update ROM programs at system execution time.